<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>我的地址</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=2.0, user-scalable=no"/>
<link href="/Public/zjdailyCard/css/bkmain.css" type="text/css" rel="stylesheet" />
</head>
<body class="addressBg">
<form>
<if condition="count($addresses) neq 0">
<ul class="ulAdd">
    <foreach name="addresses" item="address">
	<li>
    	<div class="divAdd">
            <h1 class="h1Name">{$address['username']}<span class="default" hidden>(默认)</span></h1>
            <p class="telphone">{$address['telephone']}</p>
            <p class="address">{$address['provience']} {$address['city']} {$address['region']} {$address['other']}</p>
        </div>
        <div class="divEdit">
            <php>
                //$link_addr_edit = U( '/Wap/CustomerAddr/edit', array_merge( array( 'id' => $address['id'] ), $bag['data_card'] ) );
                $link_addr_edit = "/Wap/CustomerAddr/edit";
                $k_v_pair = array_merge( array( 'id' => $address['id'] ), $bag['data_card'] );
                foreach( $k_v_pair as $key => $value ){
                    if( !empty( $value ) ){
                        $link_addr_edit = $link_addr_edit."/".$key."/".$value."";
                    }
                }
                $link_addr_back = "/Wap/ZJDailyCard/index";
                $k_v_pair = array_merge( array( 'addr_id' => $address['id'], 'bag' => 'bag'), $bag['data_card'] );
                foreach( $k_v_pair as $key => $value ){
                    if( !empty( $value ) ){
                        $link_addr_back = $link_addr_back."/".$key."/".$value."";
                    }
                }
            </php>
            <!--<div class="divIconduigou"><button type="submit" formaction="{:U('/Wap/CustomerAddr/edit', array_merge( array( 'id' => $address['id'] ), $bag['data_card'])) }" class="btnIcon icon iconfont icon-bianji"></button></div> -->
            <div class="divIconduigou"><button type="submit" formaction="{$link_addr_edit}" class="btnIcon icon iconfont icon-bianji"></button></div>
            <!--<div class="divIconbianji"><button type="submit" formaction="{:U('/Wap/ZJDailyCard/index', array_merge( array( 'bag' => 'bag', 'addr_id' => $address['id'] ), $bag['data_card'] ) ) }" formmethod="POST" class="icon iconfont icon-duigou btnIcon"></button></div> -->
            <div class="divIconbianji"><button type="submit" formaction="{$link_addr_back}" class="icon iconfont icon-duigou btnIcon"></button></div>
        </div>
    </li>
    </foreach>
</ul>
<else />
<h6 style="text-align:center">~无地址信息</h6>
</if>
</form>
<div class="addMore boxSize borderRadius"><a href="{:U('Wap/CustomerAddr/add')}">新增地址<span class="icon iconfont icon-jiahao"></span></a></div>
<div class="addMore boxSize borderRadius addMoreweb"><a href="{:U('Wap/CustomerAddr/add')}" style="color:#fff">新增地址<span class="icon iconfont icon-jiahao"></span></a></div>
<div class="divfooter mart100">
    <p>浙报新媒体技术支持</p>
    <p>联系方式：0571-85315689</p>
    <p class="pFooter">浙江日报新闻发展有限公司 | Copyright © 2014 - 2015</p>
</div>
<div class="addAdress borderRadius">
	<ul class="ulAddress ulAddresWeb">
    <li>
        <div class="spanAddress addressAdd boxSize">
            <input placeholder="姓名" type="text" class="uploadTxt uploadweb" name="userName" id="userName" data-validate="nameFormat">
             <div class="tipinfo"><div class="error icon iconfont icon-iconfontgantanhao"></div><div class="valid icon iconfont icon-gou"></div></div>
        </div>   
    </li>
    <li>
        <div class="spanAddress addressAdd boxSize">
            <input placeholder="手机号码" type="tel" class="uploadTxt uploadweb" name="telephone" id="telephone" data-validate="telephoneFormat">
             <div class="tipinfo"><div class="error icon iconfont icon-iconfontgantanhao"></div><div class="valid icon iconfont icon-gou"></div></div>
        </div>   
    </li>
     <li>
        <div class="spanAddress addressAdd boxSize">
            <select class="provience">
                <option>------</option>
            </select>
            <select class="city">
                <option>------</option>
            </select>
            <select class="region" data-validate="requireNotNull" name="region" id="region">
                <option>------</option>
            </select>
             <div class="tipinfo"><div class="error icon iconfont icon-iconfontgantanhao"></div><div class="valid icon iconfont icon-gou"></div></div>
        </div>   
    </li>
    <li class="liTxt">
     	<div class="spanAddress spanFr addressAdd boxSize">
        	<textarea placeholder="详细地址" class="txtUpload boxSize" name="detailDress" id="detailDress" data-validate="requireLength" data-min="2"></textarea>
            <div class="tipinfo"><div class="error icon iconfont icon-iconfontgantanhao"></div><div class="valid icon iconfont icon-gou"></div></div>
     	</div>
    </li>
</ul>
<div class="btn btnWeb">
    <ul class="ulBtn">
      <li>
        <input value="保存" class="saveBtn borderRadius gray" type="button">
      </li>
      <li class="fr"><a href="home.html" class="saveBtn fr backBtn boxSize borderRadius">取消</a></li>
    </ul>
</div>
</div>
</div>
<script type="text/javascript" src="/Public/zjdailyCard/js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="/Public/zjdailyCard/js/validateadd.js"></script>
<script type="text/javascript">

$( $( "span.default" )[0] ).removeAttr( "hidden" );
</script>
</body>
</html>
